

<!--    <title>京东评论词云</title>-->

<div th:include="amd.html::head-title"></div>
<script>
    var myChart = echarts.init(document.getElementById('mycloud'));
    var all = [];
    $.ajax({
            type: "GET",
            url: "/kw/list",
            dataType: "json",
            async: false,
            success: function (data) {
                for (var i = 0; i < data.length; i++) {
                    all[i] = {
                        "name": data[i].kw,
                        "value": data[i].num
                    };
                }

            }
        }
    );
    $(function(){
        echartsCloud();
    });
    function echartsCloud(){
        var myChart = echarts.init(document.getElementById('mycloud'));
        myChart.setOption({
            title: {
                text: '店铺评论词云',
                x: 'center'
            },
            tooltip: {},
            series: [{
                type : 'wordCloud',  //类型为字符云
                shape:'smooth',  //平滑
                gridSize : 16, //网格尺寸
                size : ['50%','50%'],
                //sizeRange : [ 50, 100 ],
                rotationRange : [-45, 0, 45, 90], //旋转范围
                textStyle : {
                    normal : {
                        fontFamily:'微软雅黑',
                        color: function() {
                            return 'rgb(' +
                                Math.round(Math.random() * 255) +
                                ', ' + Math.round(Math.random() * 255) +
                                ', ' + Math.round(Math.random() * 255) + ')'
                        }
                    },
                    emphasis : {
                        shadowBlur : 5,  //阴影距离
                        shadowColor : '#333'  //阴影颜色
                    }
                },
                left: 'center',
                top: 'center',
                right: null,
                bottom: null,
                width:'100%',
                height:'100%',
                data:all
            }]
        });
    }
</script>

</body>
</html>